﻿namespace Vdc.Grid
{
    using System;
    using System.Web.UI;
    using System.Web.UI.WebControls;

    internal class GridHorizontalScroller : WebControl, INamingContainer
    {
        private Vdc.Grid.Grid grid;

        public GridHorizontalScroller(Vdc.Grid.Grid _grid)
        {
            this.grid = _grid;
            this.ID = this.GetHorizontalScrollerID();
        }

        protected override void CreateChildControls()
        {
            this.CssClass = "ob_gSH";
            HtmlContainer child = new HtmlContainer {
                Text = "&#160;"
            };
            HtmlContainer container2 = new HtmlContainer {
                Text = "&#160;",
                Width = this.grid.Width
            };
            child.Controls.Add(container2);
            this.Controls.Add(child);
        }

        internal void ForceEnsureChildControls()
        {
            this.EnsureChildControls();
        }

        protected virtual string GetHorizontalScrollerID()
        {
            return ("ob_" + this.grid.GridID + "HS");
        }

        protected override HtmlTextWriterTag TagKey
        {
            get
            {
                return HtmlTextWriterTag.Div;
            }
        }
    }
}

